package com.aerfazhe.order.controller;

import com.aerfazhe.order.feign.StockClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author：wk
 * @Create：2022/4/28/21:07
 * @Description：Sentinel整合OpenFeign 控制层
 * @Version：1.0
 */
@RestController
@RequestMapping("/sentinel-openfeign")
public class SentinelOpenFeignController {

    @Autowired
    private StockClient stockClient;

    /**
     * 测试服务方异常
     * @return
     */
    @GetMapping("/add")
    public String add() {
        System.out.println("下单成功");
        String msg = stockClient.reduct2();
        return "Hello World"+msg;
    }

}
